package redlib.backend.dao;

import org.apache.ibatis.annotations.Param;
import redlib.backend.dto.query.ContactQueryDTO;
import redlib.backend.model.Contact;
import redlib.backend.vo.ContactVO;

import java.util.List;

public interface ContactMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Contact record);

    int insertSelective(Contact record);

    Contact selectByPrimaryKey(Integer id);

    Contact getByCode(
            @Param("contactCode") String contactCode,
            @Param("tenantCode") String tenantCode);

    Integer count(ContactQueryDTO queryDTO);

    List<Contact> list(@Param("queryDTO") ContactQueryDTO queryDTO, @Param("offset") Integer offset, @Param("limit") Integer limit
    );

    List<Contact> listByCodes(
            @Param("codeList") List<String> codeList,
            @Param("tenantCode") String tenantCode);

    List<Contact> listByName(
            @Param("contact") String contact,
            @Param("departmentName") String departmentName,
            @Param("contactPhone") String contactPhone,
            @Param("province") String province,
            @Param("address") String address,
            @Param("email") String email,
            @Param("tenantCode") String tenantCode);

    Contact getByName(@Param("name") String name);//获取联系人姓名

    int updateByPrimaryKeySelective(Contact record);

    int updateByPrimaryKey(Contact record);

    List<ContactVO> tongji();

    void deleteByCodes(@Param("codeList") List<Integer> codeList);
}